<%@page import="com.bean.*"%>
<%@page import="java.util.*,com.stuOperate.*"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="com.emp.database.EmpOperate,java.util.*"%>      
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%
 	//List<Student> list=(List)request.getAttribute("stulist");
	//int lastPage=(Integer)request.getAttribute("lastPage");
	//int currentPage=(Integer)request.getAttribute("currentPage");
	//Student stu = new Student();
	//stu.get
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
	function checkdel(sid) {
		if(confirm("你忍心删除本宝宝吗~~~~(>_<)~~~~")){
			window.location.href="delStu?sid="+sid+"";
		}
		
	}
</script>
</head>
<body>
	<input type="button"  value="添加学生信息"  onclick="javaScript:window.location.href='student/addStudent.jsp'"/>
	<table border="1" width="100%" cellpadding="0" cellspacing="0">
		<tr>
			<td>学生编号</td>
			<td>学生姓名</td>
			<td>学生年龄</td>
			<td>入学如期</td>
			<td>操作</td>
		</tr>
		
		<c:forEach var="stu" items="${stulist }" varStatus="vs">
		<tr bgcolor= "${vs.index%2==0 ? '#71E2AE' : '#7FD53E'}">
			<td>${stu.sid }</td>
			<td>${fn:substring(stu.sname,0,2) }</td>
			<td><fmt:formatNumber value="${stu.sage }" type="currency"/></td>
			<td><fmt:formatDate value="${stu.sdate }" pattern="yyyy/MM/dd"/></td>
			<td><a href="upStu?sid=${stu.sid }" >修改</a>/
				<a href="javaScript:void(0)" onclick=" checkdel(${stu.sid })">删除</a>
			</td>
		</tr>
		</c:forEach>
	</table>
	<div style="text-align: center;margin-top: 10px">
		当前第${currentPage }页/共${lastPage }页
		<c:if test="${currentPage!=1 }">
			<a href="ManagerStudent?currentPage=1" style="text-decoration: none;">首页</a>
			<a href="ManagerStudent?currentPage=${currentPage-1 }" style="text-decoration: none;">上一页</a>
		</c:if>
		
		
		<c:if test="${currentPage!=lastPage }">
			<span><a href="ManagerStudent?currentPage=${currentPage+1 }" style="text-decoration: none;">下一页</a></span>
			<span><a href="ManagerStudent?currentPage=${lastPage }" style="text-decoration: none;">末页</a></span>
		</c:if>
		
		
	</div>
</body>
</html>